package com.topscore.uke.mvp.presenters;

import com.topscore.uke.entities.MemberBasicInfo;
import com.topscore.uke.mvp.contractors.GetMemberDetailInfoContractor;
import com.topscore.uke.mvp.model.GetMemberDetailInfoModel;
import com.topscore.uke.network.BaseResponse;

/**
 * Created by 71468 on 2018/3/23.
 */

public class GetMemberBasicInfoPresenter implements GetMemberDetailInfoContractor,GetMemberDetailInfoContractor.Presenter {
    private View mView;
    private Model mModel;
    public GetMemberBasicInfoPresenter(View view) {
        this.mView = view;
        this.mModel = new GetMemberDetailInfoModel(new CallBack() {
            @Override
            public void onGetInfoSuccess(BaseResponse<MemberBasicInfo> response) {

            }

            @Override
            public void onError(int errorCode, String errorMessage) {
                mView.onFail(errorCode,errorMessage);
            }

            @Override
            public void onComplete() {
                mView.onLoadFinished();
            }
        });
    }

    @Override
    public void getMemberInfo(String id) {
        mView.onLoading("");
        mModel.getData(id);
    }
}
